package com.sxf.common.enums;


import com.sxf.consts.ISystemCode;

import java.text.MessageFormat;

/**
 * @author Author
 */

public enum ErrorCodeEnum implements ISystemCode {

	TOKEN_TIMEOUT(401,"登录信息已过期"),
	FORBIDDEN_ACCOUNT(9998,"您的错误次数已达到{0}次，请{1}分钟后再次尝试"),
	//前端根据该错误码判断是否需要弹出图形验证码
	ERROR_MULTI_PASSWORD(9997,"{0}"),
	PERMISSION_ERROR(9996,"无权限访问"),
	PERMISSION_PASSWORD_ERROR(9995, "请先重置密码"),
	USER_NOT_EXIST_ERROR(9994, "该用户不存在"),
	USER_PASSWORD_ERROR(9993, "账号或密码错误"),
	TOKEN_CHECK_ERROR(401, "Token验证失败"),
	PHONE_REGIST_REPEAT_ERROR(9991, "该手机号已注册"),
	IDCARD_REGIST_REPEAT_ERROR(9990, "该身份证号已注册"),
	LOGIN_PLAT_ERROR(9989, "该账号已注册平台其他角色，无法登录"),
	USER_FREEZE_ERROR(9988, "用户已冻结，请联系管理员"),
	USER_CANCEL_ERROR(9987, "用户已注销，请联系管理员"),
	
    READ_FIAL(5001, "excel文件读取失败"),
    NULL_FILE(5002, "文件为空"),
    OVER_SIZE(5003, "文件行数不能大于100行"),
    NO_DATA(5004, "没有要导入的数据"),
    EXPORT_FIAL(5005, "文件导出失败"),
    IMPORT_FIAL(5006, "文件导入失败"),

	UNAUTHORIZED_ERROR(5007,"无权登陆该系统"),

	PROJECT_EXIST_ERROR(6001,"项目已存在"),
	PROJECT_NOT_EXIST_ERROR(6002,"项目不存在"),
	CENTER_NOT_EXIST_ERROR(6003,"中心不存在"),
	SETTLE_NOT_EXIST_ERROR(6004,"结算单不存在"),
	CUSTOMER_NOT_EXIST_ERROR(6005,"客户不存在"),
	CUSTOMER_EXIST_ERROR(6006,"客户名称或客户账号后缀已存在"),
	USER_EXIST_ERROR(6006,"管理员账号已在其他客户中注册"),

	SETTLE_STATUS_NOT_APPROVED_ERROR(6004,"结算单还未审批通过"),
	SETTLE_STATUS_NOT_REJECT_ERROR(6005,"不允许修改该结算单"),



	;
	private final int status;
	private final String statusInfo;

	ErrorCodeEnum(int status, String statusInfo) {
		this.status = status;
		this.statusInfo = statusInfo;
	}

	@Override
	public int getCode() {
		return status;
	}

	@Override
	public String getMessage(Object... params) {
		return MessageFormat.format(statusInfo, params);
	}

}
